'use strict';

const Controller = require('egg').Controller;

class BlogController extends Controller {
  async getImage() {
    const idx = this.ctx.query.idx;
    const res = await this.ctx.curl('https://cn.bing.com/HPImageArchive.aspx?format=js&n=1&pid=hp&idx=' + idx);
    // console.log(res.data);
    this.ctx.body = res.data;
  }

}

module.exports = BlogController;